//
// Created by bobin on 17-8-19.
//


#ifndef OV_CALIB_IMAGECAPTURE_H
#define OV_CALIB_IMAGECAPTURE_H

#include <QThread>
#include <QMutex>
#include <opencv2/video/video.hpp>
#include <highgui.h>


class ImageCapture : public QThread {
Q_OBJECT

public:
    ImageCapture(QObject *parent = 0);

    ~ImageCapture();

    bool open_device(int number);

    cv::Mat ImgBuf;
signals:

    void image_event();

protected:
    void run() override;

private:
    cv::VideoCapture capture;
    bool terminate_flag;
    QMutex mutex_Mat;
};


#endif //OV_CALIB_IMAGECAPTURE_H
